﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace MixingStation
{
    public partial class BuckleReasonsModifyForm : Form
    {
        private string m_BuckleReasons = "";
        public string BuckleReasons
        {
            get
            {
                return m_BuckleReasons;
            }
            set
            {
                m_BuckleReasons = value;
            }
        }

        public BuckleReasonsModifyForm()
        {
            InitializeComponent();
        }

        private void BuckleReasonsModifyForm_Load(object sender, EventArgs e)
        {
            txtOriginalBuckleReasons.Text = m_BuckleReasons;
            txtNewBuckleReasons.Focus();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtNewBuckleReasons.Text.Trim()))
            {
                MessageBox.Show("修改扣杂原因不能为空");
                txtNewBuckleReasons.Focus();
                return;
            }
            if (txtOriginalBuckleReasons.Text.Trim() == txtNewBuckleReasons.Text.Trim())
            {
                MessageBox.Show("扣杂原因与原扣杂原因一致");
                txtNewBuckleReasons.Focus();
                return;
            }
            m_BuckleReasons = txtNewBuckleReasons.Text.Trim();
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }
    }
}
